<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 2. 准备容器 -->
    <div id="app">
      <h1>Vue 的模版</h1>
      <!-- 
        v-for="(item,index) in 数组"
            item    循环项
            index   索引值
      -->
      <ul>
        <li v-for="(item,index) in foods">{{ item }} ---- {{ index }}</li>
      </ul>
    </div>

    <!-- 1. 导入 vue.js -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

    <script>
      // 3. 创建 Vue 实例对象
      const app = new Vue({
        // 容器
        el: "#app",
        // 数据
        data: {
          foods: ["鸡蛋灌饼", "煎饼果子", "煲仔饭", "肠粉", "烤鸭饭", "猪脚饭"],
        },
        // 事件处理函数
        methods: {
          //
        },
      });
    </script>
  </body>
</html>
